<!doctype html>
<html>
<head>
	<meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
	<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
	<meta name="apple-mobile-web-app-capable" content="yes"/>
	<title>Bidi Mobile test - SearchBox</title>

	<script type="text/javascript" src="../../deviceTheme.js" data-dojo-config="mblThemeFiles: ['base','SearchBox']"></script>
	<script type="text/javascript" src="../../../../dojo/dojo.js" data-dojo-config="async: true, parseOnLoad: true, has: { 'dojo-bidi': true }"></script>


	
	<script type="text/javascript">
		require([
			"dojo/_base/connect",
			"dojo/ready",
			"dojo/_base/array",
			"dojo/dom",
			"dijit/registry",
			"dijit/_base/manager",
			"dojox/mobile/parser",
			"dojox/mobile",
			"dojox/mobile/SearchBox",
			"dojox/mobile/Button",
			"dojox/mobile/EdgeToEdgeDataList",
			"dojox/mobile/ScrollableView",
			"dojox/mobile/compat"
		], function(connect, ready, array, dom, registry){
			ready(function(){
				//change textDir, text
				var btnLtr = registry.byId("btn1");				
				btnLtr.connect(btnLtr, "onClick", function(){
					registry.byId("ltrSearchBox1").set("textDir", "ltr");
					registry.byId("ltrSearchBox2").set("textDir", "ltr");
					registry.byId("ltrSearchBox3").set("textDir", "ltr");
					registry.byId("ltrSearchBox4").set("textDir", "ltr");
				});
				var btnRtl = registry.byId("btn2");
				btnRtl.connect(btnRtl, "onClick", function(){
					registry.byId("ltrSearchBox1").set("textDir", "rtl");
					registry.byId("ltrSearchBox2").set("textDir", "rtl");
					registry.byId("ltrSearchBox3").set("textDir", "rtl");
					registry.byId("ltrSearchBox4").set("textDir", "rtl");				
				});	
				var btnAuto = registry.byId("btn3");
				btnAuto.connect(btnAuto, "onClick", function(){
					registry.byId("ltrSearchBox1").set("textDir", "auto");
					registry.byId("ltrSearchBox2").set("textDir", "auto");
					registry.byId("ltrSearchBox3").set("textDir", "auto");
					registry.byId("ltrSearchBox4").set("textDir", "auto");					
				});
				
				// change label for icon container				
				var btnLbl = registry.byId("btnLbl");
				btnLbl.connect(btnLbl, "onClick", function(){
				var c = registry.byId("autoSearchBox1");
				var l = c.get("label");
				c.set("label", "new");
				var n =  c.get("label");
				
					registry.byId("autoSearchBox1").set("placeHolder","\u05e9\u05dc\u05d5\u05dd END!");
					registry.byId("autoSearchBox2").set("placeHolder","FIRST \u05e9\u05dc\u05d5\u05dd!");
				});						
			});
			
		});
	</script>

	<style>
	html,body {
		height: 100%;
		overflow: hidden;
	}
	hr {
		border: none;
		margin: 0;
	}
	
	</style>
	
	
</head>
<
<body style="visibility:hidden;">
<div id="group1" data-dojo-type="dojox.mobile.View" data-dojo-props='keepScrollPos:false'><!-- keepScrollPos=false is to improve performance -->

	<div id="view0" data-dojo-type="dojox.mobile.ScrollableView">
	        <h2 data-dojo-type="dojox.mobile.Heading">SearchBox widget</h2>
		<h1 data-dojo-type="dojox.mobile.Heading">dir LTR</h1>	
		<ul data-dojo-type="dojox.mobile.EdgeToEdgeList" >
			<li id="l1" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/LTR.png", moveTo:"view1"'>Tex Dir LTR</li>
			<li id="l2" data-dojo-type="dojox.mobile.ListItem" data-dojo-props='icon:"../images/RTL.png", moveTo:"view2"'>Tex Dir RTL</li>
			<li id="l3" data-dojo-type="dojox.mobile.ListItem"  data-dojo-props='icon:"../images/auto.png", moveTo:"view3"'>Tex Dir AUTO</li>
		</ul>
		<h1 data-dojo-type="dojox.mobile.Heading">dir RTL</h1>
		<ul data-dojo-type="dojox.mobile.EdgeToEdgeList" >
			<li id="l4" data-dojo-type="dojox.mobile.ListItem"  data-dojo-props='icon:"../images/LTR.png", moveTo:"view4"'>Tex Dir LTR</li>
			<li id="l5" data-dojo-type="dojox.mobile.ListItem"  data-dojo-props='icon:"../images/RTL.png", moveTo:"view5"'>Tex Dir RTL</li>
			<li id="l6" data-dojo-type="dojox.mobile.ListItem"  data-dojo-props='icon:"../images/auto.png", moveTo:"view6"'>Tex Dir AUTO</li>
		</ul>	
	</div>	
	
	
	<div id="view1" data-dojo-type="dojox.mobile.ScrollableView">
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir LTR</h1>
		<br>
		
		
			<input data-dojo-type="dojox.mobile.SearchBox" type="search" id="ltrSearchBox1" selectOnClick="true" placeHolder="&#1513;&#1500;&#1493;&#1501!" data-dojo-props='name:"ltrSearchBox1",  textDir:"ltr"'/>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" type="search" id="ltrSearchBox2" selectOnClick="true" placeHolder="Hello!" data-dojo-props='name:"ltrSearchBox2",  textDir:"ltr"'/>
		  	    <br>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" type="search" id="ltrSearchBox3" selectOnClick="true" placeHolder="My name is &#1488;&#1502;&#1497;&#1512!" data-dojo-props='name:"ltrSearchBox3",  textDir:"ltr"'/>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" type="search" id="ltrSearchBox4" selectOnClick="true" placeHolder="&#1513;&#1502;&#1497; &#1492;&#1493;&#1488; Amir!" data-dojo-props='name:"ltrSearchBox4",  textDir:"ltr"'/>

		<br>
		<br>
		<button data-dojo-type="dojox.mobile.Button" id="btn1" class="mblRedButton" data-dojo-props='label:"Set textDir of SearchBox to ltr"'></button>
		<button data-dojo-type="dojox.mobile.Button" id="btn2" class="mblRedButton" data-dojo-props='label:"Set textDir of SearchBox to rtl"'></button>
		<button data-dojo-type="dojox.mobile.Button" id="btn3" class="mblRedButton" data-dojo-props='label:"Set textDir of SearchBox to auto"'></button>
			
	

		

	</div>
	
		
	<div id="view2" data-dojo-type="dojox.mobile.ScrollableView">
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir RTL</h1>
		
			<input data-dojo-type="dojox.mobile.SearchBox" type="search" id="rtlSearchBox1" selectOnClick="true" placeHolder="&#1513;&#1500;&#1493;&#1501!" data-dojo-props='name:"rtlSearchBox1",  textDir:"rtl"'/>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" type="search" id="rtlSearchBox2" selectOnClick="true" placeHolder="Hello!" data-dojo-props='name:"rtlSearchBox2",  textDir:"rtl"'/>
		  	    <br>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" type="search" id="rtlSearchBox3" selectOnClick="true" placeHolder="My name is &#1488;&#1502;&#1497;&#1512!" data-dojo-props='name:"rtlSearchBox3",  textDir:"rtl"'/>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" type="search" id="rtlSearchBox4" selectOnClick="true" placeHolder="&#1513;&#1502;&#1497; &#1492;&#1493;&#1488; Amir!" data-dojo-props='name:"rtlSearchBox4",  textDir:"rtl"'/>
		  	
		
		
	</div>
		
	<div id="view3" data-dojo-type="dojox.mobile.ScrollableView">	
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir LTR | textDir AUTO</h1>
		
		<input data-dojo-type="dojox.mobile.SearchBox" type="search" id="autoSearchBox1" selectOnClick="true" placeHolder="&#1513;&#1500;&#1493;&#1501!" data-dojo-props='name:"autoSearchBox1",  textDir:"auto"'/>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" type="search" id="autoSearchBox2" selectOnClick="true" placeHolder="Hello!" data-dojo-props='name:"autoSearchBox2",  textDir:"auto"'/>
		  	    <br>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" type="search" id="autoSearchBox3" selectOnClick="true" placeHolder="My name is &#1488;&#1502;&#1497;&#1512!" data-dojo-props='name:"autoSearchBox3",  textDir:"auto"'/>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" type="search" id="autoSearchBox4" selectOnClick="true" placeHolder="&#1513;&#1502;&#1497; &#1492;&#1493;&#1488; Amir!" data-dojo-props='name:"autoSearchBox4",  textDir:"auto"'/>

		<br>
		<br>
		<button data-dojo-type="dojox.mobile.Button" id="btnLbl" >Set new text Button for SearchBoxes</button>
	</div>	
	 
	 
	<div id="view4" data-dojo-type="dojox.mobile.ScrollableView">
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir LTR</h1>
		
		<input data-dojo-type="dojox.mobile.SearchBox" dir="rtl" type="search" id="ltrSearchBox5" selectOnClick="true" placeHolder="&#1513;&#1500;&#1493;&#1501!" data-dojo-props='name:"ltrSearchBox1",  textDir:"ltr"'/>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" dir="rtl" type="search" id="ltrSearchBox6" selectOnClick="true" placeHolder="Hello!" data-dojo-props='name:"ltrSearchBox2",  textDir:"ltr"'/>
		  	    <br>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" dir="rtl" type="search" id="ltrSearchBox7" selectOnClick="true" placeHolder="My name is &#1488;&#1502;&#1497;&#1512!" data-dojo-props='name:"ltrSearchBox3",  textDir:"ltr"'/>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" dir="rtl" type="search" id="ltrSearchBox8" selectOnClick="true" placeHolder="&#1513;&#1502;&#1497; &#1492;&#1493;&#1488; Amir!" data-dojo-props='name:"ltrSearchBox4",  textDir:"ltr"'/>

		
	</div>
	
	<div id="view5" data-dojo-type="dojox.mobile.ScrollableView">
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir RTL</h1>
			
		<input data-dojo-type="dojox.mobile.SearchBox" type="search" dir="rtl" id="rtlSearchBox5" selectOnClick="true" placeHolder="&#1513;&#1500;&#1493;&#1501!" data-dojo-props='name:"rtlSearchBox1",  textDir:"rtl"'/>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" dir="rtl" type="search" id="rtlSearchBox6" selectOnClick="true" placeHolder="Hello!" data-dojo-props='name:"rtlSearchBox2",  textDir:"rtl"'/>
		  	    <br>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" dir="rtl" type="search" id="rtlSearchBox7" selectOnClick="true" placeHolder="My name is &#1488;&#1502;&#1497;&#1512!" data-dojo-props='name:"rtlSearchBox3",  textDir:"rtl"'/>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" dir="rtl" type="search" id="rtlSearchBox8" selectOnClick="true" placeHolder="&#1513;&#1502;&#1497; &#1492;&#1493;&#1488; Amir!" data-dojo-props='name:"rtlSearchBox4",  textDir:"rtl"'/>
		  	
	</div>	
	
	<div dir="rtl" id="view6" data-dojo-type="dojox.mobile.ScrollableView">	
		<h1 data-dojo-type="dojox.mobile.Heading" data-dojo-props='back:"Back", moveTo:"view0"'>Dir RTL | textDir AUTO</h1>
		
		<input data-dojo-type="dojox.mobile.SearchBox" type="search" dir="rtl" id="autoSearchBox5" selectOnClick="true" placeHolder="&#1513;&#1500;&#1493;&#1501!" data-dojo-props='name:"ltrSearchBox",  textDir:"auto"'/>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" type="search" dir="rtl" id="autoSearchBox6" selectOnClick="true" placeHolder="Hello!" data-dojo-props='name:"ltrSearchBox",  textDir:"auto"'/>
		  	    <br>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" type="search" dir="rtl" id="autoSearchBox7" selectOnClick="true" placeHolder="My name is &#1488;&#1502;&#1497;&#1512!" data-dojo-props='name:"ltrSearchBox",  textDir:"auto"'/>
		  	    <input data-dojo-type="dojox.mobile.SearchBox" type="search" dir="rtl" id="autoSearchBox8" selectOnClick="true" placeHolder="&#1513;&#1502;&#1497; &#1492;&#1493;&#1488; Amir!" data-dojo-props='name:"ltrSearchBox",  textDir:"auto"'/>
	
		
	</div>	


</div>
</body>
</html>
